package com.yuma.springmvcstreamserver.service;

import org.springframework.ai.tool.annotation.Tool;
import org.springframework.ai.tool.annotation.ToolParam;
import org.springframework.stereotype.Service;

import java.util.Map;

@Service
public class ClassService {

    Map<String,String> classMap = Map.of(
            "java0325","java0325共13名学生",
            "web0209","web0209共5名学生",
            "web0910","web0910共20名学生"
    );
    @Tool(description = "获取班级信息")
    public String getClassInfo(@ToolParam(description = "班级名称,在java0325,web0209,web0910中的一个") String className) {
        if(classMap.containsKey(className.trim())){
            return classMap.get(className.trim()).toString();
        }
        return "未检索到当前班级";
    }
}